var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        });
Object.defineProperty(i, "__esModule", {value: !0});
var r = e("AppFacade"),
    s = e("AssetsMap"),
    c = e("BundleNames"),
    l = e("GlobalParam"),
    d = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t._init_load_bundles = [c.default.Start, c.default.Public, c.default.Popup, c.default.Game]),
                (t._base_bundle_assets = [c.default.Resources, c.default.Start, c.default.Public, c.default.Game]),
                t
            );
        }
        return (
            a(t, e),
            (t.prototype.execute = function () {

                
                var e = this,
                    t = ad.curr_platform === window.ad.Platform.TOU_TIAO;
                game.log("T=> 加载开始"),
                    t && window.tt.reportAnalytics("Loading_Start", {}),
                    game.UIManager.instance.showLoadResView(
                        this._init_load_bundles,
                        this._base_bundle_assets,
                        function () {
                            e.onAssetsLoadSuccess();
                        }
                    );
            }),
            (t.prototype.onAssetsLoadSuccess = function () {
                if (
                    (ad.curr_platform == window.ad.Platform.BROWSER &&
                        console.log(
                            "\n            I have implemented all the functions, and the optimization is almost the same,\n            but the code quality is too poor. It is recommended to rewrite it.\n            Good luck.\n        "
                        ),
                    (l.default.SignInData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.SignInData, cc.JsonAsset).json),
                    (l.default.ShopDateData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.ShopDateData, cc.JsonAsset).json),
                    (l.default.LuckDrawData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.LuckDrawData, cc.JsonAsset).json),
                    (l.default.GameConfigData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.GameConfigData, cc.JsonAsset).json[0]),
                    (l.default.ProgressTaskData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.ProgressTaskData, cc.JsonAsset).json),
                    (l.default.SkinLevelData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.SkinLevelData, cc.JsonAsset).json),
                    ad.curr_platform == window.ad.Platform.TOU_TIAO)
                )
                    for (var e = 0; e < l.default.SkinLevelData.length; e++) {
                        var t = l.default.SkinLevelData[e];
                        ("火龙果" != t.chinese &&
                            "魔术牌" != t.chinese &&
                            "毒蘑菇" != t.chinese &&
                            "苹果" != t.chinese) ||
                            l.default.SkinLevelData.splice(e, 1);
                    }
                (l.default.PlayerLevelData = game.BundleManager.instance
                    .getBundle(c.default.Resources)
                    .get(s.default.ResourceBundle.jsons.assetsList.PlayerLevelData, cc.JsonAsset).json),
                    (l.default.DecorateData = game.BundleManager.instance
                        .getBundle(c.default.Resources)
                        .get(s.default.ResourceBundle.jsons.assetsList.DecorateData, cc.JsonAsset).json),
                    game.UIManager.instance.replaceModuleView(
                        c.default.Start,
                        s.default.StartBundle.prefabs.assetsList.StartModuleView
                    );
                var o = ad.curr_platform === window.ad.Platform.TOU_TIAO;
                game.log("T=> 加载结束"),
                    o && window.tt.reportAnalytics("Loading_End", {}),
                    this.sendNotification(r.default.LOGIN_COMMAND);
            }),
            t
        );
    })(puremvc.SimpleCommand);
i.default = d;
